<!DOCTYPE html>
<html>
<head>
    <!--
     **
     * Author:         lihaicg
     * Contact:        lihaicg@126.com
     * Theme Name:     Violet ( Violet 主题代表着一种颜色，一种情感，还有一种美)
	 * Theme Author:   掌心 zhanxin.info@gmail.com
     **
    -->
    <meta charset="utf-8" />
    <title>
        {% if page.title %}
            {{ page.title }}
        {% else %}
            {{ site.title }}
        {% endif %}
    </title>
    <meta name="generator" content="Jekyll" />
    <meta name="author" content="{{ site.author.name }}" />
    <meta name="description" content="{{ page.description }}" />
    <meta name="keywords" content="{{ page.keywords | join: ',' }}" />
    <!-- //页面样式 -->
    <link rel="stylesheet" href="{{ site.url }}{{ site.themes }}/css/style.css" type="text/css" />
    <link rel="alternate" type="application/atom+xml" title="Recent Entries" href="{{ site.feed }}" />
    <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.1/css/font-awesome.css" rel="stylesheet">
    <link href='http://fonts.googleapis.com/css?family=Spirax' rel='stylesheet' type='text/css'>
    <link rel="shortcut icon" href="{{ site.url }}{{ site.themes }}/images/favicon.ico" type="image/x-icon" />
    <!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
</head>
<body id="violet">
    <div class="page-wrapper">
        <section class="head" id="violet-head">
            <header class="header" id="violet-header">
                <h1 class="logo"><a href="{{ site.url }}">{{ site.title }}</a></h1>
                <h2 class="subtitle">{{ site.subTitle }}</h2>
            </header>
            <nav class="nav" id="violet-nav">
                <ul class="nav-list">
                    {% for link in site.nav %}
                    {% assign active = nil %}
                    {% if page.url == link.url%}
                      {% assign active = 'nav-item-active' %}
                    {% endif %}
                    <li class="nav-item {{ active }}">
                        <a href="{{ link.url }}">
                            {{ link.text }}
                        </a>
                        {{ indicator }}
                    </li>
                    {% endfor %}
                </ul>
            </nav>
        </section>
        <section class="main" id="violet-main">
            {{ content }}
        </section>
        <footer class="foot" id="violet-foot">
            <div class="footer fn-clear">
                <h1 class="logo">Lihaicg</h1>
            </div>
            <div class="copyright">
                <div class="copyright-cnt fn-clear">
                    {% for link in site.follow %}
                    <a class="follow" href="{{ link.url }}" target="_blank"><i class="fa {{ link.class }}"></i></a>
                    {% endfor %}
                    <p class="text">©遵从CC BY-SA 知识共享协议发布</p>
                </div>
            </div>
        </footer>
    </div>

    <script type="text/javascript" src="{{ site.url }}{{ site.themes }}/js/jquery-1.8.3.js"></script>
    <script type="text/javascript" src="{{ site.url }}{{ site.themes }}/js/jquery-scrollTo.js"></script>
    <script type="text/javascript" src="{{ site.url }}{{ site.themes }}/js/common.js"></script>
    <script type="text/javascript">
        var headImgArr = [];
        {% for imgsrc in site.headimg %}
            headImgArr.push("{{ imgsrc.item }}");
        {% endfor %}
        if(headImgArr.length <= 0) {
            headImgArr = ["/themes/violet/images/hdbg03.jpg"];
            var item = 0;
        } else {
            var item = Math.floor(Math.random() * (headImgArr.length));
        }
        $("#violet-head").css({
            "background-image": "url(" + headImgArr[item] + ")"
        });
    </script>
    {% if page.comment %}
        {% if site.disqus.config %}
        <script type="text/javascript">
            //disqus
            var disqus_shortname = '{{ site.disqus.id }}';
            (function() {
                var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
                dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
                (document.getElementsByTagName('head')[0] ||
                    document.getElementsByTagName('body')[0]).appendChild(dsq);
            })();
        </script>
        {% else %}
            {% if site.duoshuo.config %}
            <script type="text/javascript">
                var duoshuoQuery = {short_name:"{{ site.duoshuo.id }}"};
                (function() {
                    var ds = document.createElement('script');
                    ds.type = 'text/javascript';ds.async = true;
                    ds.src = 'http://static.duoshuo.com/embed.js';
                    ds.charset = 'UTF-8';
                    (document.getElementsByTagName('head')[0]
                    || document.getElementsByTagName('body')[0]).appendChild(ds);
                })();
            </script>
            {% endif %}
        {% endif %}
    {% endif %}
</body>
</html>
